def eventurl(location, root, id=''):
return urljoin(location, root, 'event/', id)
+ def dmesgurl(location, root, id=''):
+ return urljoin(location, root, 'dmesg/', id)
+
def xend_request(url, method, data=None):
+ """Make a request to xend.
+
+ url xend request url
+ method http method: POST or GET
+ data request argument data (dict)
+ """
urlinfo = urlparse.urlparse(url)
(uproto, ulocation, upath, uparam, uquery, ufrag) = urlinfo
if DEBUG: print url, urlinfo
xm.prog(ProgConsole)
+class ProgCall(Prog):
+ name = "call"
+ info = "Call xend api functions."
+
+ def help (self, args):
+ print "call fn argss..."
+ print """
+ Call a xend HTTP API function. The leading 'xend_' on the function
+can be omitted. See xen.xend.XendClient for the API functions.
+"""
+
+ def main(self, args):
+ xend_client_main(args)
+
+xm.prog(ProgCall)
+
+ class ProgDmesg(Prog):
+ group = 'host'
+ name = "dmesg"
+ info = """Print Xen boot output."""
+
+ def main(self, args):
+ print server.xend_dmesg()[1]
+
+ xm.prog(ProgDmesg)
+
def main(args):
xm.main(args)